home *** CD-ROM | disk | FTP | other *** search
- In article <DLzK76.88@ukpsshp1.serigate.philips.nl>
- baynes@ukpsshp1.serigate.philips.nl (Stephen Baynes) writes:
- <snip>
- compiler - even if it then goes on to generate useful code. The whole point
- about a standard compiler is that if code compiles clean on one, it should
- compile clean on all.
-
- Incorrect if by clean you mean `warning-free'. A compiler can generate
- as many warnings as it likes, and still be conformant: the only
- requirement is that it actually create the executable, which when
- executed has the correct behaviour.
-
- Incorrect if you mean that it should compile on all, clean or not. If
- a program invokes undefined behaviour, anything can happen. It can
- compile absolutely diagnostic free on one conforming compiler and
- terminate compilation on another.
-
- Thus, according to the definition of `conforming' program, the
- following is a conforming program:
-
- double main (float x, void *y[1]) { *(char*)0 = *(char*)y;
- printf(x++ = x++ + 3); }
-
- And let us not forget that the `translation limits' clause can be read
- to mean that a compiler needs to accept one specific (rather unusual)
- program to be called conforming. So, a conforming compiler can reject
- strictly conforming code as well. (I do not accept this reading of the
- clause: but it seems to be the what the standard most plainly says).
-
- And let us not forget that given any conforming implementation, it is
- extremely easy to create another conforming implementation which
- accepts any program with atmost one warning. So, fortran can be
- trivially made into conforming c by writing a shell script around gcc
- and calling it an implementation :-)
-
- Cheers
- Tanmoy
- --
- tanmoy@qcd.lanl.gov(128.165.23.46) DECNET: BETA::"tanmoy@lanl.gov"(1.218=1242)
- Tanmoy Bhattacharya O:T-8(MS B285)LANL,NM87545 H:#9,3000,Trinity Drive,NM87544
- Others see <gopher://yaleinfo.yale.edu:7700/00/Internet-People/internet-mail>,
- <http://alpha.acast.nova.edu/cgi-bin/inmgq.pl>or<ftp://csd4.csd.uwm.edu/pub/
- internetwork-mail-guide>. -- <http://nqcd.lanl.gov/people/tanmoy/tanmoy.html>
- fax: 1 (505) 665 3003 voice: 1 (505) 665 4733 [ Home: 1 (505) 662 5596 ]
-